package cn.kkcxy.blog.core.entity.article;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;

/**
 * 
 * @TableName article_cover
 */
@TableName(value ="article_cover")
@Data
public class ArticleCover implements Serializable {
    /**
     * 文章封面图id
     */
    @TableId(value = "id")
    private Long id;

    /**
     * 文章id
     */
    @TableField(value = "article_id")
    private Long articleId;

    /**
     * 封面名称
     */
    @TableField(value = "cover_name")
    private String coverName;

    /**
     * 封面图片大小
     */
    @TableField(value = "cover_size")
    private Integer coverSize;

    /**
     * 存储桶
     */
    @TableField(value = "storage_bucket")
    private String storageBucket;

    /**
     * 存储路径
     */
    @TableField(value = "storage_url")
    private String storageUrl;

    /**
     * OSS类型
     */
    @TableField(value = "oss_type")
    private Integer ossType;

    /**
     * 创建人
     */
    @TableField(value = "created_by")
    private Long createdBy;

    /**
     * 创建时间
     */
    @TableField(value = "created_time")
    private Date createdTime;

    /**
     * 最后修改人
     */
    @TableField(value = "updated_by")
    private Long updatedBy;

    /**
     * 最后修改时间
     */
    @TableField(value = "updated_time")
    private Date updatedTime;

    /**
     * 是否被删除：0 未删除，1 已删除
     */
    @TableField(value = "deleted")
    private Integer deleted;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        ArticleCover other = (ArticleCover) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getArticleId() == null ? other.getArticleId() == null : this.getArticleId().equals(other.getArticleId()))
            && (this.getCoverName() == null ? other.getCoverName() == null : this.getCoverName().equals(other.getCoverName()))
            && (this.getCoverSize() == null ? other.getCoverSize() == null : this.getCoverSize().equals(other.getCoverSize()))
            && (this.getStorageBucket() == null ? other.getStorageBucket() == null : this.getStorageBucket().equals(other.getStorageBucket()))
            && (this.getStorageUrl() == null ? other.getStorageUrl() == null : this.getStorageUrl().equals(other.getStorageUrl()))
            && (this.getOssType() == null ? other.getOssType() == null : this.getOssType().equals(other.getOssType()))
            && (this.getCreatedBy() == null ? other.getCreatedBy() == null : this.getCreatedBy().equals(other.getCreatedBy()))
            && (this.getCreatedTime() == null ? other.getCreatedTime() == null : this.getCreatedTime().equals(other.getCreatedTime()))
            && (this.getUpdatedBy() == null ? other.getUpdatedBy() == null : this.getUpdatedBy().equals(other.getUpdatedBy()))
            && (this.getUpdatedTime() == null ? other.getUpdatedTime() == null : this.getUpdatedTime().equals(other.getUpdatedTime()))
            && (this.getDeleted() == null ? other.getDeleted() == null : this.getDeleted().equals(other.getDeleted()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getArticleId() == null) ? 0 : getArticleId().hashCode());
        result = prime * result + ((getCoverName() == null) ? 0 : getCoverName().hashCode());
        result = prime * result + ((getCoverSize() == null) ? 0 : getCoverSize().hashCode());
        result = prime * result + ((getStorageBucket() == null) ? 0 : getStorageBucket().hashCode());
        result = prime * result + ((getStorageUrl() == null) ? 0 : getStorageUrl().hashCode());
        result = prime * result + ((getOssType() == null) ? 0 : getOssType().hashCode());
        result = prime * result + ((getCreatedBy() == null) ? 0 : getCreatedBy().hashCode());
        result = prime * result + ((getCreatedTime() == null) ? 0 : getCreatedTime().hashCode());
        result = prime * result + ((getUpdatedBy() == null) ? 0 : getUpdatedBy().hashCode());
        result = prime * result + ((getUpdatedTime() == null) ? 0 : getUpdatedTime().hashCode());
        result = prime * result + ((getDeleted() == null) ? 0 : getDeleted().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", articleId=").append(articleId);
        sb.append(", coverName=").append(coverName);
        sb.append(", coverSize=").append(coverSize);
        sb.append(", storageBucket=").append(storageBucket);
        sb.append(", storageUrl=").append(storageUrl);
        sb.append(", ossType=").append(ossType);
        sb.append(", createdBy=").append(createdBy);
        sb.append(", createdTime=").append(createdTime);
        sb.append(", updatedBy=").append(updatedBy);
        sb.append(", updatedTime=").append(updatedTime);
        sb.append(", deleted=").append(deleted);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}